@import './variables';

$selectedColor: rgba(24, 144, 255, 0.05);
$lighterBlue: #1890ff;
.form-edit-container {
  position: relative;
  width: 100%;
  overflow-y: hidden;
  background-color: #f4f5f5;
  overflow-x: hidden !important;
  height: calc(100vh - 60px);
}

.components-list {
  padding: 8px;
  box-sizing: border-box;
  height: 100%;

  .components-title {
    font-size: 16px;
    color: #222;
    margin: 5px 10px;
    font-weight: bold;
  }

  .components-draggable {
    padding-bottom: 20px;
  }

  .components-item {
    display: inline-block;
    width: 48%;
    margin: 1%;
    transition: transform 0ms !important;
    cursor: move;

    .components-body {
      padding: 8px 10px;
      font-size: 12px;
      border: 1px solid transparent;
      border-radius: 6px;
      box-shadow: 0 1px 5px 0 rgba(0, 0, 0, 0.1);

      .svg-icon {
        color: #6f829e;
        font-size: 16px;
        font-weight: 700;
      }

      &:hover {
        border: $--color-primary solid 1px;
        color: $--color-primary;

        .svg-icon {
          color: $--color-primary;
        }
      }
    }
  }
}

.left-board {
  width: 260px;
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background-color: rgba(255, 255, 255, 100);
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 100);
}

.el-menu.el-menu--horizontal {
  border-bottom: none;
}

.left-scrollbar {
  height: calc(100vh - 80px);
  overflow: hidden;
  margin: 0px;
  border-radius: 7px;
}

.center-scrollbar {
  height: 97%;
  overflow: hidden;
  width: 90%;
  margin: 0px auto;
  box-sizing: border-box;
  background-color: rgb(255, 255, 255);
  border: 2px solid rgba(255, 255, 255, 100);
}

.center-board {
  height: 100%;
  width: auto;
  margin: 0 415px 85px 313px;
  box-sizing: border-box;
}

.empty-info {
  position: absolute;
  top: 36%;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 18px;
  color: $--color-primary;
  letter-spacing: 4px;
}

.operation-btn-view {
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  padding: 5px 20px 0px 20px;
  width: 90%;
  margin: 0 auto;
  border-bottom: 1px #dcdfe6 solid;
}

.center-board-row {
  padding: 12px 12px 15px 12px;
  box-sizing: border-box;
  overflow-y: hidden;
  margin-bottom: 50px;

  & > .el-form {
    // 69 = 12+15+42
    height: calc(100vh - 69px);
  }
}

.drawing-board {
  height: 100%;
  position: relative;

  .components-body {
    padding: 0;
    margin: 0;
    font-size: 0;
  }

  .sortable-ghost {
    position: relative;
    display: block;
    overflow: hidden;

    &::before {
      content: ' ';
      position: absolute;
      left: 0;
      right: 0;
      top: 0;
      height: 3px;
      background: $--color-primary;
      z-index: 2;
    }
  }

  .components-item.sortable-ghost {
    width: 100%;
    height: 60px;
    background-color: $selectedColor;
  }

  // 被选中的
  .active-from-item {
    & > .form-item,
    & > .batch-box,
    & > .drag-move {
      background: $selectedColor;
    }

    & > .drawing-item-copy,
    & > .drawing-item-delete {
      display: initial;
    }

    & .component-name {
      color: $lighterBlue;
    }
  }

  .el-form-item {
    margin-bottom: 15px;
  }
}

.drawing-item {
  position: relative;
  cursor: move;

  &.unfocus-bordered:not(.active-from-item) > div:first-child {
    //border: 1px dashed #ccc;
    box-shadow: 0 2px 4px 0 rgb(0 0 0 / 10%);
  }

  .el-form-item {
    padding: 12px 10px;
  }
}

// 子表单
.drawing-item {
  .batch-box {
    & > .batch-label {
      font-size: 16px;
      font-weight: 500;
      padding: 10px 10px;
    }

    .draggable-box {
      min-height: 60px;
      width: 100%;
      border: 1px #ccc dashed;
      background: #fff;

      .list-main {
        min-height: 60px;
        position: relative;
        border: 1px #ccc dashed;
        overflow-x: auto;
        overflow-y: auto;
        white-space: nowrap;
        padding: 10px;

        .moving {
          width: 175px;
          min-height: 94px;
          display: inline-block;
          box-sizing: border-box;
          overflow: hidden;
          padding: 0 !important;
          position: relative;
        }

        .moving::before {
          content: '';
          height: 5px;
          width: 100%;
          background: #409eff;
          position: absolute;
          top: 0;
          right: 0;
        }

        .drag-move:hover {
          & > .drawing-item-copy,
          & > .drawing-item-delete {
            display: initial;
          }
        }

        & > div {
          min-width: 185px;
          display: inline-block;
          vertical-align: top;
          border: 1px #dfe4ed dashed;
          position: relative;
          margin: 0px 2px;
        }

        .drag-move-box {
          position: relative;
          box-sizing: border-box;
          padding: 8px;
          overflow: hidden;
          //transition: all 0.1s;
          min-height: 36px;
        }
      }
    }
  }
}

// 子表单结束
.drawing-item {
  &:hover {
    & .el-form-item {
      background: $selectedColor;
      border-radius: 6px;
    }

    & > .drawing-item-copy,
    & > .drawing-item-delete {
      display: initial;
    }
  }

  & .drawing-item-copy,
  & .drawing-item-delete {
    display: none;
    position: absolute;
    top: -10px;
    width: 25px;
    height: 25px;
    line-height: 25px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    font-size: 15px;
    border: 1px solid;
    cursor: pointer;
    z-index: 1;
  }

  & .mover {
    right: 90px !important;
    color: #409eff;
    cursor: move;
  }

  & .drawing-item-copy {
    right: 56px;
    border-color: $lighterBlue;
    color: $lighterBlue;
    background: #fff;

    &:hover {
      background: $lighterBlue;
      color: #fff;
    }
  }

  & .drawing-item-delete {
    right: 24px;
    border-color: #f56c6c;
    color: #f56c6c;
    background: #fff;

    &:hover {
      background: #f56c6c;
      color: #fff;
    }
  }
}

.form-name-text {
  padding: 50px 30px 10px;
  border: 1px dashed transparent;
  line-height: 30px;
  margin: 0;
}

.describe-html {
  padding: 5px 30px;
  border: 1px dashed transparent;
}

.form-name-text input {
  border: none;
  background-color: transparent;
}

[contenteditable]:focus {
  outline: none;
  background-color: #f4f4f4;
  border: 1px solid #f4f4f4;
}

.center-name-box {
  margin: 0 10px 15px;
}

.center-desc-box {
  margin: 0 10px 15px;
  line-height: 20px;
}

.form-name-text:hover {
  //border: 1px dashed #7b7b7b;
}

.import-topic-box {
  display: flex;
  flex: 1;
  justify-content: flex-end;
}

// 考试
.evaluation-total-score {
  position: absolute;
  right: 22px;
  top: 24px;
  border-radius: 4px;
  min-width: 65px;
  min-height: 65px;
  background-color: #1890ff;

  .total-score-title {
    margin-top: 2px;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    color: #fff;
  }

  .total-score {
    text-align: center;
    font-weight: 700;
    font-size: 30px;
    color: #fff;
  }
}
